package com.hnkywl.sts.service.zjgl;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.hnkywl.sts.dao.cwgl.KhzhsfmxDao;
import com.hnkywl.sts.dao.organ.EjzhDao;
import com.hnkywl.sts.dao.organ.GsjgDao;
import com.hnkywl.sts.dao.organ.KhhDao;
import com.hnkywl.sts.dao.zjgl.YhsxDao;
import com.hnkywl.sts.dao.zjgl.YhsxmxDao;
import com.hnkywl.sts.entity.cwgl.Khzhsfmx;
import com.hnkywl.sts.entity.organ.Ejzh;
import com.hnkywl.sts.entity.organ.Khh;
import com.hnkywl.sts.entity.zjgl.Yhsx;
import com.hnkywl.sts.entity.zjgl.Yhsxmx;
import com.hnkywl.sts.service.cwgl.KhzhsfmxService;
import com.hnkywl.sts.service.organ.EjzhService;
import com.hnkywl.sts.service.organ.KhhService;
import com.hnkywl.sts.service.sys.YgService;
import com.hnkywl.sts.util.BaseUtils;
import com.hnkywl.sts.util.ReflectionUtils;
import net.ruixin.orm.hibernate.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-4-24
 * Time: 下午8:36
 * To change this template use File | Settings | File Templates.
 */
@Service
public class YhsxService {
    private YhsxDao yhsxDao;
    private YhsxmxDao yhsxmxDao;
    private GsjgDao gsjgDao;
    private YgService ygService;
    private KhzhsfmxService khzhsfmxService;
    private KhzhsfmxDao khzhsfmxDao;
    private KhhService khhService;
    private EjzhDao ejzhDao;
    private KhhDao khhDao;
    private EjzhService ejzhService;

    //银行授信列表
    @Transactional
    public String findAllYhsx(Long gsId, String gsMc, Date jkrqStart, Date jkrqEnd,  String yhMc, Integer zt, int page, int rows) {
        Long nbgsIds = null;
        Long yhIds = null;
        if (gsId != null && gsMc.equals(gsjgDao.get(gsId).getJc())) {
            nbgsIds = gsId;
        }
        Page<Yhsx> yhsxPage = this.yhsxDao.findYhsxList(nbgsIds, gsMc, jkrqStart, jkrqEnd,  yhMc, zt, page, rows);
        List<Yhsx> yhsxList = yhsxPage.getResult() == null ? new ArrayList<Yhsx>() : yhsxPage.getResult();
        String yhsxJson = BaseUtils.fetchCollectionToJson(yhsxList, "id", "nbgs.jc", "khh.jc","jkje", "yll", "jkrq", "dqrq", "lxe","sxgs.qc","sxlx","sxgsejzh.qc", "ljhk", "bz", "zdr.xm", "zt","dkf.qc");
        List<Map> yhsxSum = this.yhsxDao.findSumYhsx(gsId, yhMc ,jkrqStart, jkrqEnd, zt);
        Double jkje = 0d;
        Double lxe = 0d;
        Double ljhk = 0d;
        if (yhsxSum.size() != 0) {
            for (Map map : yhsxSum) {
                jkje += Double.valueOf((map.get("jkje") == null ? 0d : map.get("jkje")).toString());
                lxe += Double.valueOf((map.get("lxe") == null ? 0d : map.get("lxe")).toString());
                ljhk += Double.valueOf((map.get("ljhk") == null ? 0d : map.get("ljhk")).toString());
            }
            BigDecimal bigDecimal_total_jkje = new BigDecimal(jkje).setScale(2, BigDecimal.ROUND_HALF_UP);
            BigDecimal bigDecimal_total_lxe = new BigDecimal(lxe).setScale(2, BigDecimal.ROUND_HALF_UP);
            BigDecimal bigDecimal_total_ljhk = new BigDecimal(ljhk).setScale(2, BigDecimal.ROUND_HALF_UP);
            return "{\"total\":" + yhsxPage.getTotalCount() + ",\"rows\":[" + yhsxJson + "],\"footer\":[{\"jkrq\":\"合计:\",\"jkje\":\"" + bigDecimal_total_jkje + "\",\"lxe\":\"" + bigDecimal_total_lxe + "\",\"ljhk\":\"" + bigDecimal_total_ljhk + "\" }]}";
        } else {
            return "{\"total\":" + yhsxPage.getTotalCount() + ",\"rows\":[" + yhsxJson + "]}";
        }
    }

    // 保存银行授信信息
    @Transactional
    public void saveYhsx(Yhsx yhsx) {
        nullYhsx(yhsx);
        if(yhsx.getSfYhdk()==true && yhsx.getDkf()!=null){
            throw new RuntimeException("银行贷款贷款方不必填写");
        }
        if(yhsx.getSfYhdk()==false && yhsx.getDkf()==null){
            throw new RuntimeException("非银行贷款贷款方必填");
        }
        yhsx.setKhh(khhService.findKhhById(yhsx.getKhh().getId()));
        yhsx.setDateCreated(new Date());
        yhsx.setCreateUser(YgService.getCurrentYg());
        yhsx.setCreateOrgan(YgService.getCurrentYg().getZggs());
        yhsx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        yhsx.setLastUpdated(yhsx.getDateCreated());
        yhsx.setSxlx("yhsx");
        this.yhsxDao.save(yhsx);
    }

    // 保存银行授信信息
    @Transactional
    public void saveWlysx(Yhsx yhsx) {
        nullYhsx(yhsx);
        yhsx.setKhh(khhService.findKhhById(yhsx.getKhh().getId()));
//        yhsx.setLxe(getNum(Double.parseDouble(yhsx.getJkje().toString()) * ((getDateEdit(yhsx.getDqrq(), yhsx.getJkrq())) * (yhsx.getYll() / 1000 / 30))));
        yhsx.setDateCreated(new Date());
        yhsx.setCreateUser(YgService.getCurrentYg());
        yhsx.setCreateOrgan(YgService.getCurrentYg().getZggs());
        yhsx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        yhsx.setLastUpdated(yhsx.getDateCreated());
        yhsx.setSxgsejzh(ejzhDao.get(yhsx.getSxgsejzh().getId()));
        yhsx.setSxlx("wlysx");
        this.yhsxDao.save(yhsx);
    }
    public Double yhsxLxjs(Long yhsxId,Double yhsxmxHkje,Date yhsxmxHkrq) {
        Double lxe = 0.0;
        Yhsx yhsx = yhsxDao.get(yhsxId);
        if(yhsxmxHkje!=null && yhsxmxHkrq != null) {
             lxe = getNum(yhsxmxHkje * ((getDateEdit(yhsxmxHkrq, yhsx.getJkrq())) * (yhsx.getYll() / 1000 / 30)));
        }
        return lxe;

    }


    // 保存银行授信信息
    @Transactional
    public void saveOldYhsx(Yhsx yhsx) {
        this.yhsxDao.save(yhsx);
    }

    // 更新银行授信信息
    @Transactional
    public void updateYhsx(Yhsx yhsx) {
        if(yhsx.getSfYhdk()==true && yhsx.getDkf()!=null){
            throw new RuntimeException("银行贷款贷款方不必填写");
        }
        if(yhsx.getSfYhdk()==false && yhsx.getDkf()==null){
            throw new RuntimeException("非银行贷款贷款方必填");
        }
        Yhsx clone = this.findYhsxDetail(yhsx.getId());
        nullYhsx(yhsx);
        clone = (Yhsx) ReflectionUtils.getInstance(clone, yhsx);
        clone.setLastUpdated(new Date());
        clone.setSxlx("yhsx");
        clone.setKhh(khhService.findKhhById(yhsx.getKhh().getId()));
        this.yhsxDao.save(clone);
        if (yhsx.getYhsxmxList() != null) {
            for (Yhsxmx y : yhsx.getYhsxmxList()) {
                Yhsxmx yhsxmx = this.yhsxmxDao.get(y.getId());
                yhsxmx.setJkje(clone.getJkje().floatValue());
                yhsxmx.setLastUpdated(new Date());
                this.yhsxmxDao.save(yhsxmx);
            }
        }
    }

    // 更新银行授信信息
    @Transactional
    public void updateWlysx(Yhsx yhsx) {
        Yhsx clone = this.findYhsxDetail(yhsx.getId());
        nullYhsx(yhsx);
        clone = (Yhsx) ReflectionUtils.getInstance(clone, yhsx);
        clone.setLastUpdated(new Date());
        clone.setLxe(getNum(Double.parseDouble(yhsx.getJkje().toString()) * ((getDateEdit(yhsx.getDqrq(), yhsx.getJkrq())) * (yhsx.getYll() / 1000 / 30))));
        clone.setSxgsejzh(ejzhDao.get(yhsx.getSxgsejzh().getId()));
        clone.setSxlx("wlysx");
        this.yhsxDao.save(clone);
        if (yhsx.getYhsxmxList() != null) {
            for (Yhsxmx y : yhsx.getYhsxmxList()) {
                Yhsxmx yhsxmx = this.yhsxmxDao.get(y.getId());
                yhsxmx.setJkje(clone.getJkje().floatValue());
                yhsxmx.setLastUpdated(new Date());
                this.yhsxmxDao.save(yhsxmx);
            }
        }
    }


    // 删除银行授信信息
    @Transactional
    public void deleteYhsx(Long id) {
        Yhsx yhsx = yhsxDao.get(id);
        yhsx.setLastUpdated(new Date());
        yhsx.setDeleted(1);
        this.yhsxDao.save(yhsx);
    }

    // 查询银行授信明细
    @Transactional
    public Yhsx findYhsxDetail(Long id) {
        return this.yhsxDao.get(id);
    }

    //银行授信还款
    @Transactional
    public void yhsxHk(Long yhsxId, Yhsxmx yhsxmx, Long sqrId) {
        Yhsx yhsx = this.findYhsxDetail(yhsxId);
        Double ljhk = (yhsx.getLjhk() == null ? 0 : Double.parseDouble(yhsx.getLjhk().toString())) + (yhsxmx.getHkje() == null ? 0 : Double.parseDouble(yhsxmx.getHkje().toString()));
        if (ljhk > Double.parseDouble(yhsx.getJkje().toString())) {
            throw new RuntimeException("累计回款总金额不得大于借款总金额！");
        } else if (ljhk < Double.parseDouble(yhsx.getJkje().toString()) && ljhk != 0d) {
            yhsx.setZt(2); //还款中
        } else {
            yhsx.setZt(3); //已还款
        }
        yhsx.setLjhk(ljhk);
        this.yhsxDao.save(yhsx);
        yhsxmx.setYhsx(yhsx);
        yhsxmx.setDateCreated(new Date());
        yhsxmx.setCreateUser(YgService.getCurrentYg());
        yhsxmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
        yhsxmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        yhsxmx.setLastUpdated(yhsxmx.getDateCreated());
        if(yhsx.getSxlx().equals("yhsx")){
        yhsxmx.setYhsxsflx("fk");
        }
        if(yhsx.getSxlx().equals("wlysx")){
            yhsxmx.setYhsxsflx("fk");
        }
        this.yhsxmxDao.save(yhsxmx);
        if (yhsxmx.getHkje() != null && Double.parseDouble(yhsxmx.getHkje().toString()) != 0) {
            Khzhsfmx khzhsfmx = new Khzhsfmx();
            khzhsfmx.setNbgs(yhsx.getNbgs());
            if(yhsx.getSxlx().equals("yhsx")){
                khzhsfmx.setType(2); //1 增加存款 2.减少存款
            }
            if(yhsx.getSxlx().equals("wlysx")){
                khzhsfmx.setType(2); //1 增加存款 2.减少存款
            }
            khzhsfmx.setRzyh(yhsx.getKhh());
            khzhsfmx.setZh(1); //1.存款户  2 保证金
            khzhsfmx.setJe(Double.parseDouble(yhsxmx.getHkje().toString()));
            khzhsfmx.setYhsx(yhsx);
            if (sqrId == null) {
                khzhsfmx.setShr(null);
            } else {
                khzhsfmx.setShr(ygService.findYgDetail(sqrId));
            }
            khzhsfmx.setZdr(YgService.getCurrentYg());
            khzhsfmx.setGllx(2); //还款
            khzhsfmx.setCreateUser(YgService.getCurrentYg());
            khzhsfmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
            khzhsfmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
            khzhsfmx.setDateCreated(new Date());
            khzhsfmx.setLastUpdated(khzhsfmx.getDateCreated());
            khzhsfmx.setYhsxmx(yhsxmx);
            this.khzhsfmxService.saveKhzhsfmx(khzhsfmx);
        }

        if (yhsxmx.getHxje() != null && yhsxmx.getHxje() != 0) {
            Khzhsfmx khzhsfmx = new Khzhsfmx();
            khzhsfmx.setNbgs(yhsx.getNbgs());
            if(yhsx.getSxlx().equals("yhsx")){
                khzhsfmx.setType(2); //1 增加存款 2.减少存款
            }
            if(yhsx.getSxlx().equals("wlysx")){
                khzhsfmx.setType(1); //1 增加存款 2.减少存款
            }
            khzhsfmx.setRzyh(yhsx.getKhh());
            khzhsfmx.setZh(1); //1.存款户  2 保证金
            khzhsfmx.setJe(yhsxmx.getHxje());
            khzhsfmx.setYhsx(yhsx);
            if (sqrId == null) {
                khzhsfmx.setShr(null);
            } else {
                khzhsfmx.setShr(ygService.findYgDetail(sqrId));
            }
            khzhsfmx.setZdr(YgService.getCurrentYg());
            khzhsfmx.setGllx(3); //付息
            khzhsfmx.setCreateUser(YgService.getCurrentYg());
            khzhsfmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
            khzhsfmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
            khzhsfmx.setDateCreated(new Date());
            khzhsfmx.setLastUpdated(khzhsfmx.getDateCreated());
            khzhsfmx.setYhsxmx(yhsxmx);
            this.khzhsfmxService.saveKhzhsfmx(khzhsfmx);
        }

        if(yhsx.getSxlx().equals("yhsx")){
            //真实账户可用余额减少
            Khh h = yhsx.getKhh();
            h.setKyye(h.getKyye()==null?0.0:h.getKyye()-Double.parseDouble(yhsxmx.getHkje().toString()));
            khhDao.save(h);
        }
        if(yhsx.getSxlx().equals("wlysx")){
            //真实账户可用余额增加  二级账户可用余额减少
            Khh h = yhsx.getKhh();
            h.setKyye((h.getKyye()==null?0.0:h.getKyye())+Double.parseDouble(yhsxmx.getHkje().toString()));
            h.setSxe((h.getSxe()==null?0.0:h.getSxe())-Double.parseDouble(yhsxmx.getHkje().toString()));
            khhDao.save(h);
            Ejzh e = ejzhDao.findKyyeByKhId(yhsx.getNbgs().getId(),yhsx.getNbgs().getId());
            e.setKyye((e.getKyye()==null?0.0:e.getKyye())-Double.parseDouble(yhsxmx.getHkje().toString()));
            e.setSxe((e.getSxe()==null?0.0:e.getSxe())-Double.parseDouble(yhsxmx.getHkje().toString()));
            ejzhDao.save(e);
        }
    }

    // 银行授信还款明细
    public String findYhsxHkmx(Yhsx yhsx) {
        Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
        List<Map> yhsxmxList = this.yhsxDao.findYhsxHkmx(yhsx);
        Double hkje = 0d;//还款金额
        Double hxje = 0d;//还息金额
        String result = "";
        if (yhsxmxList.size() > 0) {
            for (Map map : yhsxmxList) {
                hkje += map.get("hkje") == null ? 0d : (Double) map.get("hkje");
                hxje += map.get("hxje") == null ? 0d : (Double) map.get("hxje");
            }
            result = "{\"rows\":" + gson.toJson(yhsxmxList) + ",\"footer\":[{\"nbgs.qc\":\"合计:\",\"hkje\":" + hkje + ",\"hxje\":" + hxje + " }]}";
        } else {
            result = "{\"rows\":" + gson.toJson(yhsxmxList) + "}";
        }
        return result;
    }

    @Transactional
    public void yhsxConfirm(Long yhsxId, Integer zt) {
        Yhsx yhsx = this.findYhsxDetail(yhsxId);
        //修改银行的状态为确认  生成借款
        yhsx.setZt(zt);
        this.yhsxDao.save(yhsx);

        //银行收付明细表增加一条收款的银行授信
        Yhsxmx yhsxmx = new Yhsxmx();
        yhsxmx.setYhsx(yhsx);
        yhsxmx.setDateCreated(new Date());
        yhsxmx.setCreateUser(YgService.getCurrentYg());
        yhsxmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
        yhsxmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        yhsxmx.setLastUpdated(yhsxmx.getDateCreated());
        if(yhsx.getSxlx().equals("yhsx")){
            yhsxmx.setYhsxsflx("sk");
        }
        if(yhsx.getSxlx().equals("wlysx")){
            yhsxmx.setYhsxsflx("sk");
        }
        this.yhsxmxDao.save(yhsxmx);

        //开户账户收付明细增加一条数据 增加存款
        Khzhsfmx khzhsfmx = new Khzhsfmx();
        khzhsfmx.setNbgs(yhsx.getNbgs());
        if(yhsx.getSxlx().equals("yhsx")){
            khzhsfmx.setType(1); //1.增加存款 2.减少存款
        }
        if(yhsx.getSxlx().equals("wlysx")){
            khzhsfmx.setType(1); //1.增加存款 2.减少存款
        }
        khzhsfmx.setRzyh(yhsx.getKhh());
        khzhsfmx.setZh(1); //1.存款户  2 保证金
        khzhsfmx.setJe(yhsxmx.getHxje());
        khzhsfmx.setYhsx(yhsx);
        khzhsfmx.setShr(null);
        khzhsfmx.setZdr(YgService.getCurrentYg());
        khzhsfmx.setGllx(1); //银行借款
        khzhsfmx.setCreateUser(YgService.getCurrentYg());
        khzhsfmx.setCreateOrgan(YgService.getCurrentYg().getZggs());
        khzhsfmx.setCreateDepartment(YgService.getCurrentYg().getZgjg());
        khzhsfmx.setDateCreated(new Date());
        khzhsfmx.setLastUpdated(khzhsfmx.getDateCreated());
        this.khzhsfmxService.saveKhzhsfmx(khzhsfmx);
        if(yhsx.getSxlx().equals("yhsx")){
            //真实账户可用余额减少  二级账户可用余额增加
            Khh h = yhsx.getKhh();
            Double khhKyye = h.getKyye()==null?0.0:h.getKyye();
            Double khhSxe = h.getSxe()==null?0.0:h.getSxe();
            h.setKyye(khhKyye+Double.parseDouble(yhsx.getJkje().toString()));
            h.setSxe(khhSxe+Double.parseDouble(yhsx.getJkje().toString()));
            khhDao.save(h);
        }
        if(yhsx.getSxlx().equals("wlysx")){
            //真实账户可用余额减少  二级账户可用余额增加
            Khh h = yhsx.getKhh();
            Double khhKyye = h.getKyye()==null?0.0:h.getKyye();
            Double khhSxe = h.getSxe()==null?0.0:h.getSxe();
            h.setKyye(khhKyye+Double.parseDouble(yhsx.getJkje().toString()));
            h.setSxe(khhSxe-Double.parseDouble(yhsx.getJkje().toString()));
            khhDao.save(h);
            Ejzh e = ejzhDao.findKyyeByKhId(yhsx.getNbgs().getId(),yhsx.getNbgs().getId());
            Double ejzhKyye = e.getKyye()==null?0.0:e.getKyye();
            Double ejzhSxe = e.getSxe()==null?0.0:e.getSxe();
            e.setKyye(ejzhKyye+Double.parseDouble(yhsx.getJkje().toString()));
            e.setSxe(ejzhSxe+Double.parseDouble(yhsx.getJkje().toString()));
            ejzhDao.save(e);
        }
    }

    @Transactional
    public void qxqrYhsx(Long yhsxId) {
        Yhsx yhsx = this.findYhsxDetail(yhsxId);
        yhsx.setZt(0);
        this.yhsxDao.save(yhsx);
        //银行收付明细表增加一条收款的银行授信删除
        if (yhsx.getYhsxmxList().size() > 0) {
            for (Yhsxmx yhsxmx : yhsx.getYhsxmxList()) {
                yhsxmx.setDeleted(1);
                yhsxmx.setLastUpdated(new Date());
                yhsxmxDao.save(yhsxmx);
            }
        }
        //开户账户收付明细增加一条数据 增加存款删除
        List<Khzhsfmx> khzhsfmxList = khzhsfmxDao.findKhzhsfmxByYhsx(yhsxId);
        if (khzhsfmxList.size() > 0) {
            for (Khzhsfmx khzhsfmx : khzhsfmxList) {
                khzhsfmx.setDeleted(1);
                khzhsfmx.setLastUpdated(new Date());
                this.khzhsfmxDao.save(khzhsfmx);
            }
        }
        if(yhsx.getSxlx().equals("yhsx")){
            //真实账户可用余额减少  二级账户可用余额增加
            Khh h = yhsx.getKhh();  
            h.setKyye(h.getKyye()==null?0.0:h.getKyye()-Double.parseDouble(yhsx.getJkje().toString()));
            h.setSxe((h.getSxe()==null?0.0:h.getSxe())-Double.parseDouble(yhsx.getJkje().toString()));
            khhDao.save(h);
        }
        if(yhsx.getSxlx().equals("wlysx")){
            //真实账户可用余额减少  二级账户可用余额增加
            Khh h = yhsx.getKhh();
            h.setKyye((h.getKyye()==null?0.0:h.getKyye())-Double.parseDouble(yhsx.getJkje().toString()));
            h.setSxe((h.getSxe()==null?0.0:h.getSxe())+Double.parseDouble(yhsx.getJkje().toString()));
            khhDao.save(h);
            Ejzh e = ejzhDao.findKyyeByKhId(yhsx.getNbgs().getId(),yhsx.getNbgs().getId());
            e.setKyye((e.getKyye()==null?0.0:e.getKyye())-Double.parseDouble(yhsx.getJkje().toString()));
            e.setSxe((e.getSxe()==null?0.0:e.getSxe())-Double.parseDouble(yhsx.getJkje().toString()));
            ejzhDao.save(e);
        }
    }


    // ajax远程验证
    public boolean ajaxValidate(Long id, String value, Object field) {
        return this.yhsxmxDao.checkUnique(id, value, field);
    }

    //关联判断
    private void nullYhsx(Yhsx yhsx) {
        if (yhsx != null && yhsx.getNbgs() != null && yhsx.getNbgs().getId() == null)
            yhsx.setNbgs(null);
        if (yhsx != null && yhsx.getKhh() != null && yhsx.getKhh().getId() == null)
            yhsx.setKhh(null);
    }

    //时间计算
    public Long getDateEdit(Date date1, Date date2) {
        Long times = date1.getTime() - date2.getTime();
        return times / 24 / 60 / 60 / 1000;
    }

    //取值范围
    public Double getNum(Double f) {
        BigDecimal b = new BigDecimal(f);
        Double num = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
        return num;
    }

    @Autowired
    public void setYhsxDao(YhsxDao yhsxDao) {
        this.yhsxDao = yhsxDao;
    }

    @Autowired
    public void setGsjgDao(GsjgDao gsjgDao) {
        this.gsjgDao = gsjgDao;
    }

    @Autowired
    public void setYgService(YgService ygService) {
        this.ygService = ygService;
    }

    @Autowired
    public void setKhzhsfmxService(KhzhsfmxService khzhsfmxService) {
        this.khzhsfmxService = khzhsfmxService;
    }

    @Autowired
    public void setYhsxmxDao(YhsxmxDao yhsxmxDao) {
        this.yhsxmxDao = yhsxmxDao;
    }

    @Autowired
    public void setKhhService(KhhService khhService) {
        this.khhService = khhService;
    }

    @Autowired
    public void setKhzhsfmxDao(KhzhsfmxDao khzhsfmxDao) {
        this.khzhsfmxDao = khzhsfmxDao;
    }
    @Autowired
    public void setEjzhDao(EjzhDao ejzhDao) {
        this.ejzhDao = ejzhDao;
    }
    @Autowired
    public void setKhhDao(KhhDao khhDao) {
        this.khhDao = khhDao;
    }
    @Autowired
    public void setEjzhService(EjzhService ejzhService) {
        this.ejzhService = ejzhService;
    }
}
